//--------------- Controlador principal de la aplicacion ---------------
var registry = null;
var engine = null;

var EBMainMgr = Class.create( );
EBMainMgr.prototype = {
    initialize: function( ) {
		registry.setEntry( 'config', new EBConfig( ) );
		registry.setEntry( 'priority', new EBPriority() );
		registry.setEntry( 'event-data', new EBEventData() );
		registry.setEntry( 'days-data', new EBEventDayData() );
		registry.setEntry( 'days', new EBEventDays() );
		registry.setEntry( 'uevents-data', new EBUndefinedEventData() );
		registry.setEntry( 'uevents', new EBUndefinedEvents() );
		registry.setEntry( 'event-list-data', new EBEventListData() );
		registry.setEntry( 'event-list', new EBEventList() );
		registry.setEntry( 'zoom', new EBZoomManager() );
		registry.setEntry( 'layout', new EBLayoutManager() );
    },
    
    start: function( ) {
	    $RGC().setZoom();
    	registry.setEntry( 'browser', new eventBrowser($RGC().mainContainer) );  	
    	
	    $RGE('priority').startSlider();
	    $RGE('days').start();
	    $RGE('browser').start();
	    $RGE('uevents').start();
	    $RGE('event-list').start();
	}
}

//main de la aplicacion

Event.observe( window, 'load',
  function( ) {
	registry = new EBRegistry( );
	engine = new EBMainMgr( );
	engine.start( );
}
);
